<!DOCTYPE html>
<html>
  <head></head>
  <body>
  </body>
  <script>
    function appendEmbedToDOM(url, type) {
      var object = document.createElement("object");
      var embed = document.createElement("embed");
      embed.src = url;
      embed.setAttribute("type", type);
      object.appendChild(embed);
      document.body.appendChild(object);
    }

    function appendDataEmbedToDOM(url, type) {
      var object = document.createElement("object");
      object.setAttribute("data", url);
      object.setAttribute("type", type);
      document.body.appendChild(object);
    }
  </script>
</html>
